UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utaHAggTaKguNnMJvW9TF7tlSIOIlskMX/4VStS62Mo=' 
WHERE 
  key_id = '6545a0fafc0b926c21e09a85dc65770c21bdeb42eaa7322de73cf607ab1e6e2a' 
  AND (
    token = 'utaHAggTaKguNnMJvW9TF7tlSIOIlskMX/4VStS62Mo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033