UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0s/lgtwNNieidQH0hZiz9ihyuuaF3YvIw4IFR2xz3QA=' 
WHERE 
  key_id = 'b2f4704111c4a71860fd87b9db182347fd39f7a66c84b95ae7ee99a7e4fea8e9' 
  AND (
    token = '0s/lgtwNNieidQH0hZiz9ihyuuaF3YvIw4IFR2xz3QA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027