UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WOoCZ1oFTiQWkXI9eG6AxWNwTLxCHhWvE03QqAOamxo=' 
WHERE 
  key_id = '8a1bd03cd8a35e6ec518c80aade9978709207804de1bb2534c77eadfead9586c' 
  AND (
    token = 'WOoCZ1oFTiQWkXI9eG6AxWNwTLxCHhWvE03QqAOamxo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029