UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p+VJuYak51JPLE/Zh5MiI7dH1Znc7c8XuWnfg60iOGk=' 
WHERE 
  key_id = 'e704cdc8875e5f694bf7ae85cc62cfe2aff1f23e8f5b10c01d7787fdcdf77360' 
  AND (
    token = 'p+VJuYak51JPLE/Zh5MiI7dH1Znc7c8XuWnfg60iOGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025