UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't2qqU8/X4dcDFDQh/HN5o+ZSD9Mo9HXzmokAowcinUU=' 
WHERE 
  key_id = '5fdd2d664d89dc5c199a3b22d8ad3068afa80637fffa54a9f391e8dd8e75636f' 
  AND (
    token = 't2qqU8/X4dcDFDQh/HN5o+ZSD9Mo9HXzmokAowcinUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026