UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yR2FRfW5BpCcq7pTbdA85tVr/SwPGbriZLru+hffU4g=' 
WHERE 
  key_id = 'f739d45fcaa8bce77e7d4969499e24ac77a6b9fececeb0c0f6f9d12ffca53018' 
  AND (
    token = 'yR2FRfW5BpCcq7pTbdA85tVr/SwPGbriZLru+hffU4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021