UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UxoTvpbi+FW6GTpSogAKp7xYiYfUrCUnprmlZpv02bc=' 
WHERE 
  key_id = 'd558e6ea9cb91c8664c5ecd37bff21edad2045e84ca226721e3ca211c18bad04' 
  AND (
    token = 'UxoTvpbi+FW6GTpSogAKp7xYiYfUrCUnprmlZpv02bc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038