UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uv79yMOAJwo7/Wp7aUVhYIgDx4C44XT9JtEcKEQ3VA0=' 
WHERE 
  key_id = 'c804f7ce6d71a632b2df718f0dbe2146fe3c1e47fcf8792a193e7729544cb344' 
  AND (
    token = 'Uv79yMOAJwo7/Wp7aUVhYIgDx4C44XT9JtEcKEQ3VA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025