UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OzEWCtpo/Nf2ynBtUqmo2pMX6M/NotDTCmdMroWVB5g=' 
WHERE 
  key_id = 'ebadc56dcc1ad7544cc1eeeb0923ec1f4b14de14fac690596f2bf4dac2390519' 
  AND (
    token = 'OzEWCtpo/Nf2ynBtUqmo2pMX6M/NotDTCmdMroWVB5g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064