UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PdKTcAMXlYi2yPYZh5Zgq/oemwhXA0uINnHfybhNEuw=' 
WHERE 
  key_id = 'f272921542fb75bbd176f5001ce8f9a0d3897e2a4581c409b54fc7e177534599' 
  AND (
    token = 'PdKTcAMXlYi2yPYZh5Zgq/oemwhXA0uINnHfybhNEuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027