UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uw/ECUqOtZ5thj2A38XlrB+ji76bGrMlP5j9Ud9pXGQ=' 
WHERE 
  key_id = '9a72dadd0c8c20b7b16fc2d2e1851f71038a0da36b90e8a7556041242cc6f52a' 
  AND (
    token = 'Uw/ECUqOtZ5thj2A38XlrB+ji76bGrMlP5j9Ud9pXGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043