UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1VsSzwKC+LSheUat7nMO9mRRp8TjKj5pB55MwPH0OS8=' 
WHERE 
  key_id = '2685ba2a879d3c490f9e44745cc82c2c72c5a04f65f5eac39c2e05dba8a0a135' 
  AND (
    token = '1VsSzwKC+LSheUat7nMO9mRRp8TjKj5pB55MwPH0OS8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028