UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'faiIMM17gq39oP33+/NWjQmwYQERsDFa1udxTQi5Nrs=' 
WHERE 
  key_id = 'e68716ec770d56a259e86abb1240ce4815e24f07aaddad3e05352ba78a174927' 
  AND (
    token = 'faiIMM17gq39oP33+/NWjQmwYQERsDFa1udxTQi5Nrs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029