UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uXjt/Wqf/+CjItiIYBdhiQC4Czh+nW9WIyukzcbvvgw=' 
WHERE 
  key_id = 'f1770d33dfa8211501d32f61c1e4d0e696863e71f2cbadd1c4232f50e6b4a963' 
  AND (
    token = 'uXjt/Wqf/+CjItiIYBdhiQC4Czh+nW9WIyukzcbvvgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048