UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/QV0OUF5bGzs3tBoAKpDaRiCd/LbD0GOzw5JKGMg2NA=' 
WHERE 
  key_id = '327736974aaf48bea3fbdb95aab4f176131ce882d53f8f237189cac8a3b1d8ba' 
  AND (
    token = '/QV0OUF5bGzs3tBoAKpDaRiCd/LbD0GOzw5JKGMg2NA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033