UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sEAhZbDMyLZ/wrcm3vAM9S3p6d2EIKvsIoCM0412Rms=' 
WHERE 
  key_id = '7ec3795cbfdb27017ba87a9f8195b98f528d193a954b0081849fc09c0fe9d262' 
  AND (
    token = 'sEAhZbDMyLZ/wrcm3vAM9S3p6d2EIKvsIoCM0412Rms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028