UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PBdiEE7NrVetIdh2GGvLE3YZ8Gra5KS5pPd4nsO//JM=' 
WHERE 
  key_id = 'c48eb73c1d1d465a2bb522f8ff330a9a8f738f51e0cfd43728977b897c505bf1' 
  AND (
    token = 'PBdiEE7NrVetIdh2GGvLE3YZ8Gra5KS5pPd4nsO//JM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019