UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LD0y77zaOySUcvP05ZNC5BtORacbRb/IjtjemgIlE10=' 
WHERE 
  key_id = '6066102b5ec83e373cc8e86527939eb0a6eb6d48f0ad0bfd15dbcd65585ad9bd' 
  AND (
    token = 'LD0y77zaOySUcvP05ZNC5BtORacbRb/IjtjemgIlE10=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038