UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jFiYRaRk3KsgeuWFxGcrnmlbGXsuo/mtVvSX+ZAFU3Y=' 
WHERE 
  key_id = 'f4f7ad636bcd65d7d0cdf8fa924da4ab858a3cee5ed6e17b37076e497593a9e4' 
  AND (
    token = 'jFiYRaRk3KsgeuWFxGcrnmlbGXsuo/mtVvSX+ZAFU3Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021