UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'limBFJEeDGiipmRXjUhBWKU1TbBxvUSpdzM/yDBZxDM=' 
WHERE 
  key_id = 'efa92d9eefe33df6c8a44200ad64916172e522dd8a43af51079c400cdc7debb6' 
  AND (
    token = 'limBFJEeDGiipmRXjUhBWKU1TbBxvUSpdzM/yDBZxDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028