UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o02Rzfe+Fxyuk2Q7eJPMAfUuKUaGdRAot03BAOjJ6E4=' 
WHERE 
  key_id = '00a1ce546dcfb69ea76b9936af935fe6890609d59de1e0d09402522b3db29324' 
  AND (
    token = 'o02Rzfe+Fxyuk2Q7eJPMAfUuKUaGdRAot03BAOjJ6E4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029