UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RIjyV1DGWrRxTXFUbnEEbV/oJpGPv3UAE1B6ZuXjKUo=' 
WHERE 
  key_id = 'b5a265ccb7f000de810ecb47b969e7beb292f8151ff84dbd85254074ab5ad7c5' 
  AND (
    token = 'RIjyV1DGWrRxTXFUbnEEbV/oJpGPv3UAE1B6ZuXjKUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020