UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gXDaHNLDLPdinQgmP6CLIBMBx/UnDyCJhyVrR+TQ4m0=' 
WHERE 
  key_id = '56468ce088e6c7c8c418361185f5b0a80a4896553a150b06f25afadaf8477c19' 
  AND (
    token = 'gXDaHNLDLPdinQgmP6CLIBMBx/UnDyCJhyVrR+TQ4m0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031