UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HKhfXXrFeFPIfhMPntzPMiJmqZMARgNAbXIqIdPPsPE=' 
WHERE 
  key_id = 'aaa7cf3c2a3a3ffc8ba6b15b201f20d5de270ceef0309f5d2dbd875984fcdbf0' 
  AND (
    token = 'HKhfXXrFeFPIfhMPntzPMiJmqZMARgNAbXIqIdPPsPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030