UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xaVxcg4cUtdtLi49tQBZOzhy4Vb1F7r9DJLlYM6AKhE=' 
WHERE 
  key_id = '66ae13349ad668b64a7c8c1e3a7d97e032c5df2f65396cf9fd3a77a31b7ce2e0' 
  AND (
    token = 'xaVxcg4cUtdtLi49tQBZOzhy4Vb1F7r9DJLlYM6AKhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064