UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iulJcxK6L+LIma3LvhFFcq5baOhR1Li49keMQFy5w98=' 
WHERE 
  key_id = '2d9e8de042b2678767dfe6538e097ace86ddc2ab7e01dda72d8e17af676977d0' 
  AND (
    token = 'iulJcxK6L+LIma3LvhFFcq5baOhR1Li49keMQFy5w98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033