UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZmeUUVpAzLqC+9FR8hJSkcqNCn2HbLsoE4azndNYOJU=' 
WHERE 
  key_id = 'bb98e6f1700dc85944bbd4ccbaf0097ae2b7877d3b21e331931ed19761225aa8' 
  AND (
    token = 'ZmeUUVpAzLqC+9FR8hJSkcqNCn2HbLsoE4azndNYOJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042