UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3ttXLMwQg47PQe/IP/LBwPgPNer9fkXNwsmY8tDduwk=' 
WHERE 
  key_id = 'bd7459799a535e93c2d1501d6a213874facf3bdddf03ed179a55ea40df0bf791' 
  AND (
    token = '3ttXLMwQg47PQe/IP/LBwPgPNer9fkXNwsmY8tDduwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020