UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OT0h1q6OfxmmUwkTobQxaJ6vdYUs944tsJlC221xjNg=' 
WHERE 
  key_id = '428b2fa4ccc3901ef3896b76cd0a20a3bf8221d7076be54f3fe799b2c6043faa' 
  AND (
    token = 'OT0h1q6OfxmmUwkTobQxaJ6vdYUs944tsJlC221xjNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023