UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gbdIm3Jh+dOfeyF9y7V/h2861sxXqA2f76QW89ZQXKY=' 
WHERE 
  key_id = 'fd9429a7f41a8fe403854d86690cc59971c9d69a0ca938bcf2eac2fc0c041c68' 
  AND (
    token = 'gbdIm3Jh+dOfeyF9y7V/h2861sxXqA2f76QW89ZQXKY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036