UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/fEIw9h5PSuz5pmaRmwJSfy9ZLuKzX9mJeFaEB0VhSo=' 
WHERE 
  key_id = '18458dc1658b8c576f38770fcbe497d387502d4e7194b4c64ccd9582711f9f05' 
  AND (
    token = '/fEIw9h5PSuz5pmaRmwJSfy9ZLuKzX9mJeFaEB0VhSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043