UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uP+DTFrgzhNtxsWZkWSO5pW0pQvNOvLnEGBfmotR2so=' 
WHERE 
  key_id = '2ccd51a080c54d7758f61c97b5a21e7bc34205212039f6ad34a10a353d235049' 
  AND (
    token = 'uP+DTFrgzhNtxsWZkWSO5pW0pQvNOvLnEGBfmotR2so=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041