UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5GNWgosKFtJt2MLN1gfnC+btgLyDNADBg+Nubsik4LY=' 
WHERE 
  key_id = 'dd7bd026c89aa785133d0825c01ef59e64ffecc667d7f7465da78063ae2079a0' 
  AND (
    token = '5GNWgosKFtJt2MLN1gfnC+btgLyDNADBg+Nubsik4LY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029