UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KEVExgCeCCJSr/ezKM9Vz9yXedI+Rq9cUr34FgNT4Ps=' 
WHERE 
  key_id = 'b33721c53b21601c90d5a5ba314623c9bcbdb4cc4562b9c7ab7baa0bac59dae0' 
  AND (
    token = 'KEVExgCeCCJSr/ezKM9Vz9yXedI+Rq9cUr34FgNT4Ps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028