UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/6XL/bsZqLijjOiArT6+xfxEVN4GjzoeslA4NzW5Mzw=' 
WHERE 
  key_id = 'e9e35643b4f04829fafece4e10ea71527b8241e199db0dd1373251cc1222420c' 
  AND (
    token = '/6XL/bsZqLijjOiArT6+xfxEVN4GjzoeslA4NzW5Mzw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028