UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/GH2uxQKSgW+q/+yeG1pXPq5tr0vgEjV3jDJJx2du4Q=' 
WHERE 
  key_id = '5e85bc358a6986c6f267c889b4370e044dfcd2e88bf99e0389d4f39e9653af6c' 
  AND (
    token = '/GH2uxQKSgW+q/+yeG1pXPq5tr0vgEjV3jDJJx2du4Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015